﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
 

namespace RBS.Admin.Controllers
{
    public class HomeController : BaseController
    {
        //
        // GET: /Home/
        protected Core.Model.manager AdminInfo;
        public ActionResult Index()
        {
            if (!IsAdminLogin())
            {
                  return RedirectToAction("Index","Login");
            }
           AdminInfo = GetAdminInfo();
           ViewData["AdminInfo"] = AdminInfo;
           ViewBag.UserName  = AdminInfo.user_name;
           ViewBag.RoleName = new RBS.Core.BLL.manager_role().GetTitle(AdminInfo.role_id);
            return View();

        }

        public ActionResult Logout()
        {
            FormsAuthentication.SignOut();
            Session.Abandon();
            return RedirectToAction("Index","Login");
        }
        [HttpPost]
        public ActionResult manager_pwd(int id, Core.Model.manager person)
        {

            new Core.BLL.manager().Update(person);
            return View();
        }

        public ActionResult manager_pwd()
        {
            AdminInfo = GetAdminInfo();
            return View(AdminInfo);
        }

        public ActionResult Main()
        {
            return View();
        }



    }
}
